package czh.cocoa.graphics;

import czh.cocoa.foundation.NSObject;
import czh.cocoa.foundation.NSString;

public class CGSize extends NSObject {

	public float width;
	
	public float height;
	
	public CGSize() {
		this(0,0);
	}
	
	public CGSize(float width, float height) {
		this.width = width;
		this.height = height;
	}
	
	public CGSize(CGSize size) {
		this.width = size.width;
		this.height = size.height;
	}

	public CGSize clone() {
		return new CGSize(width, height);
	}
	
	public boolean isEqual(NSObject o) {
		if(o instanceof CGSize) {
			CGSize other = (CGSize) o;
			return width == other.width && height == other.height;
		}
		return false;
	}
	
	public NSString description() {
		return NSTR("(" + width + ", " + height +  ")");
	}
	
	public static CGSize CGSizeMake(float width, float height) {
		return new CGSize(width, height);
	}
	
}
